﻿<Window
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
		xmlns:y="clr-namespace:PhotoAlbumWorkflow" xmlns:SampleData="clr-namespace:Expression.Blend.SampleData.SampleImages" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="PhotoAlbumWorkflow.MainWindow"
        Title="Photo Album Workflow" Height="350" Width="525" Loaded="Window_Loaded">
	<Window.Resources>
        <y:PathToFileNameConverter x:Key="pathToFileConverter" />
		<SampleData:SampleImages x:Key="SampleImages" d:IsDataSource="True"/>
		<DataTemplate x:Key="ItemTemplate">
			<StackPanel Orientation="Horizontal" Background="{Binding Highlight, IsAsync=True, Mode=OneWay}">
                <Image HorizontalAlignment="Left" Height="32" Width="32" Margin="2" Source="{Binding AsyncImage}"  Loaded="Image_Loaded">
                </Image>
                <TextBlock Text="{Binding FileName, Converter={StaticResource pathToFileConverter}}" VerticalAlignment="Center" FontSize="16" FontFamily="MS Reference Sans Serif"/>
			</StackPanel>
		</DataTemplate>
	</Window.Resources>
    <Grid >
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>
        <StackPanel x:Name="ButtonStack" Orientation="Horizontal" Height="42">
            <Button x:Name="ClearButton" HorizontalAlignment="Left" Width="{Binding Height, Mode=OneTime}" ToolTip="Clear" Margin="3" Click="Clear_Click">
            		<Image x:Name="image" Source="Icons/Close.ico" Stretch="Fill"/>
			</Button>
			<Button x:Name="SettingsButton" HorizontalAlignment="Left" Width="{Binding Height, Mode=OneTime}" ToolTip="Settings" Margin="3" Click="Settings_Click">
				<Image Source="Icons/settings.ico" Stretch="Fill"/>
			</Button>
            <Button x:Name="BrowseButton" HorizontalAlignment="Left" Width="{Binding Height, Mode=OneTime}" ToolTip="Browse" Margin="3" Click="Browse_Click">
            		<Image Source="Icons/042b_AddCategory.ico" Stretch="Fill"/>
			</Button>
            <Button x:Name="SetTimeButton" HorizontalAlignment="Left" Width="{Binding Height, Mode=OneTime}" ToolTip="Set Date Created" Margin="3" Click="SetTime_Click">
                <Image Source="Icons/Stopwatch.ico" Stretch="Fill"/>
            </Button>
            <Button x:Name="SetTitleButton" HorizontalAlignment="Left" Width="{Binding Height, Mode=OneTime}" ToolTip="Set Title" Margin="3" Click="SetTitle_Click">
            		<Image Source="Icons/126_Edit.ico" Stretch="Fill"/>
			</Button>
            <Button x:Name="RenameButton" HorizontalAlignment="Left" Width="{Binding Height, Mode=OneTime}" ToolTip="Rename" Margin="3" Click="Rename_Click">
            		<Image Source="Icons/Rename.ico" Stretch="Fill"/>
			</Button>
            
        </StackPanel>
        <ListBox x:Name="contentListBox" AllowDrop="True" DragEnter="contentListBox_DragEnter" DragLeave="contentListBox_DragLeave" Drop="contentListBox_Drop" Grid.Row="1" ItemTemplate="{DynamicResource ItemTemplate}" ItemsSource="{Binding Collection}" d:DataContext="{Binding Source={StaticResource SampleImages}}"/>
    </Grid>
</Window>
